package com.haina.shop.controller.index;

import com.haina.shop.domain.ProdComm;
import com.haina.shop.dto.CommPageDTO;
import com.haina.shop.result.IPageIndexImg;
import com.haina.shop.result.ServiceResult;
import com.haina.shop.service.ProdCommService;
import com.haina.shop.vo.CommPageVo;
import com.haina.shop.vo.ProdCommVo;
import com.haina.shop.vo.ProdCommVo1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProdCommController {

    @Autowired
    private ProdCommService prodCommService;

    @GetMapping("/prodComm/prodCommData")
    public ServiceResult getProdCommData(@RequestParam("prodId") Long prodId) {

        prodCommService.getNumber(prodId);
        return ServiceResult.success();
    }

    @GetMapping("/prodComm/prodCommPageByProd")
    public ServiceResult<IPageIndexImg<ProdCommVo1>> getPage(CommPageDTO commPageDTO){

        return prodCommService.getPage1(commPageDTO);


    }



}
